<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录测试 - Bou Scheduler</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-5">
        <div class="row">
            <div class="col-md-6 offset-md-3">
                <div class="card">
                    <div class="card-header">
                        <h4>登录测试页面</h4>
                    </div>
                    <div class="card-body">
                        <div class="alert alert-info">
                            <strong>测试说明：</strong><br>
                            1. 这个页面用于测试登录功能<br>
                            2. 默认账号：admin / admin123<br>
                            3. 登录成功后会重定向到首页
                        </div>
                        
                        <form action="/login" method="post">
                            <div class="mb-3">
                                <label for="username" class="form-label">用户名</label>
                                <input type="text" class="form-control" id="username" name="username" value="admin" required>
                            </div>
                            <div class="mb-3">
                                <label for="password" class="form-label">密码</label>
                                <input type="password" class="form-control" id="password" name="password" value="admin123" required>
                            </div>
                            <div class="d-grid">
                                <button type="submit" class="btn btn-primary">测试登录</button>
                            </div>
                        </form>
                        
                        <hr>
                        
                        <div class="mt-3">
                            <h6>其他测试链接：</h6>
                            <a href="/login" class="btn btn-outline-secondary btn-sm me-2">登录页面</a>
                            <a href="/" class="btn btn-outline-secondary btn-sm me-2">首页</a>
                            <a href="/tasks" class="btn btn-outline-secondary btn-sm me-2">任务管理</a>
                            <a href="/monitor" class="btn btn-outline-secondary btn-sm me-2">监控统计</a>
                        </div>
                        
                        <div class="mt-3">
                            <h6>调试信息：</h6>
                            <small class="text-muted">
                                如果登录后仍然停留在登录页面，请检查：<br>
                                1. 浏览器控制台是否有错误信息<br>
                                2. 网络请求的响应状态<br>
                                3. 服务端日志信息
                            </small>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 页面加载完成后的调试信息
        document.addEventListener('DOMContentLoaded', function() {
            console.log('测试页面加载完成');
            console.log('当前URL:', window.location.href);
            console.log('表单已准备就绪');
            
            // 监听表单提交
            document.querySelector('form').addEventListener('submit', function(e) {
                console.log('表单提交事件触发');
                console.log('用户名:', document.getElementById('username').value);
                console.log('密码:', document.getElementById('password').value);
            });
        });
    </script>
</body>
</html>
